<!--
 * @Author: zhangxiangsheng 1026583651@qq.com
 * @Date: 2024-06-24 14:42:24
 * @LastEditors: zhangxiangsheng 1026583651@qq.com
 * @LastEditTime: 2024-06-24 16:11:38
 * @FilePath: \appGly\pages\USearch\udmaedt.vue
 * @Description: 
 * 
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. 
-->
<template>
	<view>
		<u-navbar title="用户查看"></u-navbar>
		<formz ref="formz" :inputs="inputs" :data="data"></formz>
		<fixedbtn>
			<u-button type="primary" @click="save" :loading="loading">
				{{ $z.$t("确认修改") }}
			</u-button>
		</fixedbtn>
		<zmodal ref="zmodal"></zmodal>
	</view>
</template>

<script>
	import json from "./json";
	export default {
		data() {
			return {
				inputs: json.Udmaedt,
				loading: false,
				data: {},
				query: {},
			};
		},
		onLoad(query) {
			this.query = query;
			this.init();
		},
		methods: {
			async init() {
				let user = await this.$z.request("/USearch", this.query);
				this.data = user[0];
			},

			async save() {
				let data = await this.$refs.formz.validate();
				this.loading = true;
				let par = await this.$z.request("/Udmaedt", data);
				if (par[0].par == "succeed") {
					this.$z.back();
				} else {
					this.$u.toast(this.$z.$t("旧密码错误"));
				}
				this.loading = false;
			},
		},
	};
</script>

<style></style>